package com.xmut.mall.product.feign;

import com.xmut.mall.product.utils.RespBean;
import com.xmut.mall.product.vo.OrderEntityVo;
import com.xmut.mall.product.vo.OrderItemEntityVo;
import com.xmut.mall.product.vo.OrderLogEntityVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("mall-order")
public interface OrderFeignService {

    /**
     * 增加订单的日志
     * @param orderLogEntity
     * @return
     */
    @PostMapping("/order/orderlog/addOrderLog")
    RespBean addOrderLog(@RequestBody OrderLogEntityVo orderLogEntity);

    /**
     * 保存订单
     * @param entity
     * @return
     */
    @PostMapping("/order/order/createOrder")
    RespBean createOrder(@RequestBody OrderEntityVo entity);

    /**
     * 创建订单项
     * @param entity
     * @return
     */
    @PostMapping("/order/orderitem/createOrderItem")
    RespBean createOrderItem(@RequestBody List<OrderItemEntityVo> entity);

    @GetMapping("/test/testFeignJwt")
    RespBean testFeignJwt();
}
